(0) Obligation:

Clauses:

flatten(atom(X), .(X, [])).
flatten(cons(atom(X), U), .(X, Y)) :- flatten(U, Y).
flatten(cons(cons(U, V), W), X) :- flatten(cons(U, cons(V, W)), X).
count(atom(X), s(0)).
count(cons(atom(X), Y), s(Z)) :- count(Y, Z).
count(cons(cons(U, V), W), Z) :- ','(flatten(cons(cons(U, V), W), X), count(X, Z)).

Query: count(g,a)

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(2) Obligation:

Triples:

flattenD(cons(atom(X1), X2), .(X1, X3)) :- flattenD(X2, X3).
flattenD(cons(cons(X1, X2), X3), X4) :- flattenC(X1, X2, X3, X4).
flattenC(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) :- flattenD(X3, X4).
flattenC(atom(X1), cons(X2, X3), X4, .(X1, X5)) :- flattenC(X2, X3, X4, X5).
flattenC(cons(X1, X2), X3, X4, X5) :- flattenC(X1, X2, cons(X3, X4), X5).
countA(cons(atom(X1), cons(atom(X2), X3)), s(s(X4))) :- countA(X3, X4).
countA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) :- flattenC(X2, X3, X4, X6).
countA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) :- ','(flattencB(X2, X3, X4, X6), countA(X6, X5)).
countA(cons(cons(X1, X2), X3), X4) :- flattenC(X1, X2, X3, X5).
countA(cons(cons(X1, X2), X3), X4) :- ','(flattencC(X1, X2, X3, X5), countA(X5, X4)).

Clauses:

countcA(atom(X1), s(0)).
countcA(cons(atom(X1), atom(X2)), s(s(0))).
countcA(cons(atom(X1), cons(atom(X2), X3)), s(s(X4))) :- countcA(X3, X4).
countcA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) :- ','(flattencB(X2, X3, X4, X6), countcA(X6, X5)).
countcA(cons(cons(X1, X2), X3), X4) :- ','(flattencC(X1, X2, X3, X5), countcA(X5, X4)).
flattencD(atom(X1), .(X1, [])).
flattencD(cons(atom(X1), X2), .(X1, X3)) :- flattencD(X2, X3).
flattencD(cons(cons(X1, X2), X3), X4) :- flattencC(X1, X2, X3, X4).
flattencC(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) :- flattencD(X3, X4).
flattencC(atom(X1), cons(X2, X3), X4, .(X1, X5)) :- flattencC(X2, X3, X4, X5).
flattencC(cons(X1, X2), X3, X4, X5) :- flattencC(X1, X2, cons(X3, X4), X5).
flattencB(X1, X2, X3, X4) :- flattencC(X1, X2, X3, X4).

Afs:

countA(x1, x2)  =  countA(x1)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
countA_in: (b,f)
flattenC_in: (b,b,b,f)
flattenD_in: (b,f)
flattencB_in: (b,b,b,f)
flattencC_in: (b,b,b,f)
flattencD_in: (b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3)), s(s(X4))) → U6_GA(X1, X2, X3, X4, countA_in_ga(X3, X4))
COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3)), s(s(X4))) → COUNTA_IN_GA(X3, X4)
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) → U7_GA(X1, X2, X3, X4, X5, flattenC_in_ggga(X2, X3, X4, X6))
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) → FLATTENC_IN_GGGA(X2, X3, X4, X6)
FLATTENC_IN_GGGA(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → U3_GGGA(X1, X2, X3, X4, flattenD_in_ga(X3, X4))
FLATTENC_IN_GGGA(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → FLATTEND_IN_GA(X3, X4)
FLATTEND_IN_GA(cons(atom(X1), X2), .(X1, X3)) → U1_GA(X1, X2, X3, flattenD_in_ga(X2, X3))
FLATTEND_IN_GA(cons(atom(X1), X2), .(X1, X3)) → FLATTEND_IN_GA(X2, X3)
FLATTEND_IN_GA(cons(cons(X1, X2), X3), X4) → U2_GA(X1, X2, X3, X4, flattenC_in_ggga(X1, X2, X3, X4))
FLATTEND_IN_GA(cons(cons(X1, X2), X3), X4) → FLATTENC_IN_GGGA(X1, X2, X3, X4)
FLATTENC_IN_GGGA(atom(X1), cons(X2, X3), X4, .(X1, X5)) → U4_GGGA(X1, X2, X3, X4, X5, flattenC_in_ggga(X2, X3, X4, X5))
FLATTENC_IN_GGGA(atom(X1), cons(X2, X3), X4, .(X1, X5)) → FLATTENC_IN_GGGA(X2, X3, X4, X5)
FLATTENC_IN_GGGA(cons(X1, X2), X3, X4, X5) → U5_GGGA(X1, X2, X3, X4, X5, flattenC_in_ggga(X1, X2, cons(X3, X4), X5))
FLATTENC_IN_GGGA(cons(X1, X2), X3, X4, X5) → FLATTENC_IN_GGGA(X1, X2, cons(X3, X4), X5)
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) → U8_GA(X1, X2, X3, X4, X5, flattencB_in_ggga(X2, X3, X4, X6))
U8_GA(X1, X2, X3, X4, X5, flattencB_out_ggga(X2, X3, X4, X6)) → U9_GA(X1, X2, X3, X4, X5, countA_in_ga(X6, X5))
U8_GA(X1, X2, X3, X4, X5, flattencB_out_ggga(X2, X3, X4, X6)) → COUNTA_IN_GA(X6, X5)
COUNTA_IN_GA(cons(cons(X1, X2), X3), X4) → U10_GA(X1, X2, X3, X4, flattenC_in_ggga(X1, X2, X3, X5))
COUNTA_IN_GA(cons(cons(X1, X2), X3), X4) → FLATTENC_IN_GGGA(X1, X2, X3, X5)
COUNTA_IN_GA(cons(cons(X1, X2), X3), X4) → U11_GA(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X5))
U11_GA(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X5)) → U12_GA(X1, X2, X3, X4, countA_in_ga(X5, X4))
U11_GA(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5, X4)

The TRS R consists of the following rules:

flattencB_in_ggga(X1, X2, X3, X4) → U24_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X4))
flattencC_in_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → U21_ggga(X1, X2, X3, X4, flattencD_in_ga(X3, X4))
flattencD_in_ga(atom(X1), .(X1, [])) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2), .(X1, X3)) → U19_ga(X1, X2, X3, flattencD_in_ga(X2, X3))
flattencD_in_ga(cons(cons(X1, X2), X3), X4) → U20_ga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X4))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5)) → U22_ggga(X1, X2, X3, X4, X5, flattencC_in_ggga(X2, X3, X4, X5))
flattencC_in_ggga(cons(X1, X2), X3, X4, X5) → U23_ggga(X1, X2, X3, X4, X5, flattencC_in_ggga(X1, X2, cons(X3, X4), X5))
U23_ggga(X1, X2, X3, X4, X5, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, X5, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
U20_ga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, X3, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))
U21_ggga(X1, X2, X3, X4, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U24_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)

The argument filtering Pi contains the following mapping:
countA_in_ga(x1, x2)  =  countA_in_ga(x1)
cons(x1, x2)  =  cons(x1, x2)
atom(x1)  =  atom(x1)
flattenC_in_ggga(x1, x2, x3, x4)  =  flattenC_in_ggga(x1, x2, x3)
flattenD_in_ga(x1, x2)  =  flattenD_in_ga(x1)
flattencB_in_ggga(x1, x2, x3, x4)  =  flattencB_in_ggga(x1, x2, x3)
U24_ggga(x1, x2, x3, x4, x5)  =  U24_ggga(x1, x2, x3, x5)
flattencC_in_ggga(x1, x2, x3, x4)  =  flattencC_in_ggga(x1, x2, x3)
U21_ggga(x1, x2, x3, x4, x5)  =  U21_ggga(x1, x2, x3, x5)
flattencD_in_ga(x1, x2)  =  flattencD_in_ga(x1)
flattencD_out_ga(x1, x2)  =  flattencD_out_ga(x1, x2)
U19_ga(x1, x2, x3, x4)  =  U19_ga(x1, x2, x4)
U20_ga(x1, x2, x3, x4, x5)  =  U20_ga(x1, x2, x3, x5)
U22_ggga(x1, x2, x3, x4, x5, x6)  =  U22_ggga(x1, x2, x3, x4, x6)
U23_ggga(x1, x2, x3, x4, x5, x6)  =  U23_ggga(x1, x2, x3, x4, x6)
flattencC_out_ggga(x1, x2, x3, x4)  =  flattencC_out_ggga(x1, x2, x3, x4)
flattencB_out_ggga(x1, x2, x3, x4)  =  flattencB_out_ggga(x1, x2, x3, x4)
.(x1, x2)  =  .(x1, x2)
COUNTA_IN_GA(x1, x2)  =  COUNTA_IN_GA(x1)
U6_GA(x1, x2, x3, x4, x5)  =  U6_GA(x1, x2, x3, x5)
U7_GA(x1, x2, x3, x4, x5, x6)  =  U7_GA(x1, x2, x3, x4, x6)
FLATTENC_IN_GGGA(x1, x2, x3, x4)  =  FLATTENC_IN_GGGA(x1, x2, x3)
U3_GGGA(x1, x2, x3, x4, x5)  =  U3_GGGA(x1, x2, x3, x5)
FLATTEND_IN_GA(x1, x2)  =  FLATTEND_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x1, x2, x4)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x2, x3, x5)
U4_GGGA(x1, x2, x3, x4, x5, x6)  =  U4_GGGA(x1, x2, x3, x4, x6)
U5_GGGA(x1, x2, x3, x4, x5, x6)  =  U5_GGGA(x1, x2, x3, x4, x6)
U8_GA(x1, x2, x3, x4, x5, x6)  =  U8_GA(x1, x2, x3, x4, x6)
U9_GA(x1, x2, x3, x4, x5, x6)  =  U9_GA(x1, x2, x3, x4, x6)
U10_GA(x1, x2, x3, x4, x5)  =  U10_GA(x1, x2, x3, x5)
U11_GA(x1, x2, x3, x4, x5)  =  U11_GA(x1, x2, x3, x5)
U12_GA(x1, x2, x3, x4, x5)  =  U12_GA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3)), s(s(X4))) → U6_GA(X1, X2, X3, X4, countA_in_ga(X3, X4))
COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3)), s(s(X4))) → COUNTA_IN_GA(X3, X4)
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) → U7_GA(X1, X2, X3, X4, X5, flattenC_in_ggga(X2, X3, X4, X6))
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) → FLATTENC_IN_GGGA(X2, X3, X4, X6)
FLATTENC_IN_GGGA(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → U3_GGGA(X1, X2, X3, X4, flattenD_in_ga(X3, X4))
FLATTENC_IN_GGGA(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → FLATTEND_IN_GA(X3, X4)
FLATTEND_IN_GA(cons(atom(X1), X2), .(X1, X3)) → U1_GA(X1, X2, X3, flattenD_in_ga(X2, X3))
FLATTEND_IN_GA(cons(atom(X1), X2), .(X1, X3)) → FLATTEND_IN_GA(X2, X3)
FLATTEND_IN_GA(cons(cons(X1, X2), X3), X4) → U2_GA(X1, X2, X3, X4, flattenC_in_ggga(X1, X2, X3, X4))
FLATTEND_IN_GA(cons(cons(X1, X2), X3), X4) → FLATTENC_IN_GGGA(X1, X2, X3, X4)
FLATTENC_IN_GGGA(atom(X1), cons(X2, X3), X4, .(X1, X5)) → U4_GGGA(X1, X2, X3, X4, X5, flattenC_in_ggga(X2, X3, X4, X5))
FLATTENC_IN_GGGA(atom(X1), cons(X2, X3), X4, .(X1, X5)) → FLATTENC_IN_GGGA(X2, X3, X4, X5)
FLATTENC_IN_GGGA(cons(X1, X2), X3, X4, X5) → U5_GGGA(X1, X2, X3, X4, X5, flattenC_in_ggga(X1, X2, cons(X3, X4), X5))
FLATTENC_IN_GGGA(cons(X1, X2), X3, X4, X5) → FLATTENC_IN_GGGA(X1, X2, cons(X3, X4), X5)
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) → U8_GA(X1, X2, X3, X4, X5, flattencB_in_ggga(X2, X3, X4, X6))
U8_GA(X1, X2, X3, X4, X5, flattencB_out_ggga(X2, X3, X4, X6)) → U9_GA(X1, X2, X3, X4, X5, countA_in_ga(X6, X5))
U8_GA(X1, X2, X3, X4, X5, flattencB_out_ggga(X2, X3, X4, X6)) → COUNTA_IN_GA(X6, X5)
COUNTA_IN_GA(cons(cons(X1, X2), X3), X4) → U10_GA(X1, X2, X3, X4, flattenC_in_ggga(X1, X2, X3, X5))
COUNTA_IN_GA(cons(cons(X1, X2), X3), X4) → FLATTENC_IN_GGGA(X1, X2, X3, X5)
COUNTA_IN_GA(cons(cons(X1, X2), X3), X4) → U11_GA(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X5))
U11_GA(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X5)) → U12_GA(X1, X2, X3, X4, countA_in_ga(X5, X4))
U11_GA(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5, X4)

The TRS R consists of the following rules:

flattencB_in_ggga(X1, X2, X3, X4) → U24_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X4))
flattencC_in_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → U21_ggga(X1, X2, X3, X4, flattencD_in_ga(X3, X4))
flattencD_in_ga(atom(X1), .(X1, [])) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2), .(X1, X3)) → U19_ga(X1, X2, X3, flattencD_in_ga(X2, X3))
flattencD_in_ga(cons(cons(X1, X2), X3), X4) → U20_ga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X4))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5)) → U22_ggga(X1, X2, X3, X4, X5, flattencC_in_ggga(X2, X3, X4, X5))
flattencC_in_ggga(cons(X1, X2), X3, X4, X5) → U23_ggga(X1, X2, X3, X4, X5, flattencC_in_ggga(X1, X2, cons(X3, X4), X5))
U23_ggga(X1, X2, X3, X4, X5, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, X5, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
U20_ga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, X3, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))
U21_ggga(X1, X2, X3, X4, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U24_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)

The argument filtering Pi contains the following mapping:
countA_in_ga(x1, x2)  =  countA_in_ga(x1)
cons(x1, x2)  =  cons(x1, x2)
atom(x1)  =  atom(x1)
flattenC_in_ggga(x1, x2, x3, x4)  =  flattenC_in_ggga(x1, x2, x3)
flattenD_in_ga(x1, x2)  =  flattenD_in_ga(x1)
flattencB_in_ggga(x1, x2, x3, x4)  =  flattencB_in_ggga(x1, x2, x3)
U24_ggga(x1, x2, x3, x4, x5)  =  U24_ggga(x1, x2, x3, x5)
flattencC_in_ggga(x1, x2, x3, x4)  =  flattencC_in_ggga(x1, x2, x3)
U21_ggga(x1, x2, x3, x4, x5)  =  U21_ggga(x1, x2, x3, x5)
flattencD_in_ga(x1, x2)  =  flattencD_in_ga(x1)
flattencD_out_ga(x1, x2)  =  flattencD_out_ga(x1, x2)
U19_ga(x1, x2, x3, x4)  =  U19_ga(x1, x2, x4)
U20_ga(x1, x2, x3, x4, x5)  =  U20_ga(x1, x2, x3, x5)
U22_ggga(x1, x2, x3, x4, x5, x6)  =  U22_ggga(x1, x2, x3, x4, x6)
U23_ggga(x1, x2, x3, x4, x5, x6)  =  U23_ggga(x1, x2, x3, x4, x6)
flattencC_out_ggga(x1, x2, x3, x4)  =  flattencC_out_ggga(x1, x2, x3, x4)
flattencB_out_ggga(x1, x2, x3, x4)  =  flattencB_out_ggga(x1, x2, x3, x4)
.(x1, x2)  =  .(x1, x2)
COUNTA_IN_GA(x1, x2)  =  COUNTA_IN_GA(x1)
U6_GA(x1, x2, x3, x4, x5)  =  U6_GA(x1, x2, x3, x5)
U7_GA(x1, x2, x3, x4, x5, x6)  =  U7_GA(x1, x2, x3, x4, x6)
FLATTENC_IN_GGGA(x1, x2, x3, x4)  =  FLATTENC_IN_GGGA(x1, x2, x3)
U3_GGGA(x1, x2, x3, x4, x5)  =  U3_GGGA(x1, x2, x3, x5)
FLATTEND_IN_GA(x1, x2)  =  FLATTEND_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x1, x2, x4)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x2, x3, x5)
U4_GGGA(x1, x2, x3, x4, x5, x6)  =  U4_GGGA(x1, x2, x3, x4, x6)
U5_GGGA(x1, x2, x3, x4, x5, x6)  =  U5_GGGA(x1, x2, x3, x4, x6)
U8_GA(x1, x2, x3, x4, x5, x6)  =  U8_GA(x1, x2, x3, x4, x6)
U9_GA(x1, x2, x3, x4, x5, x6)  =  U9_GA(x1, x2, x3, x4, x6)
U10_GA(x1, x2, x3, x4, x5)  =  U10_GA(x1, x2, x3, x5)
U11_GA(x1, x2, x3, x4, x5)  =  U11_GA(x1, x2, x3, x5)
U12_GA(x1, x2, x3, x4, x5)  =  U12_GA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 12 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FLATTENC_IN_GGGA(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → FLATTEND_IN_GA(X3, X4)
FLATTEND_IN_GA(cons(atom(X1), X2), .(X1, X3)) → FLATTEND_IN_GA(X2, X3)
FLATTEND_IN_GA(cons(cons(X1, X2), X3), X4) → FLATTENC_IN_GGGA(X1, X2, X3, X4)
FLATTENC_IN_GGGA(atom(X1), cons(X2, X3), X4, .(X1, X5)) → FLATTENC_IN_GGGA(X2, X3, X4, X5)
FLATTENC_IN_GGGA(cons(X1, X2), X3, X4, X5) → FLATTENC_IN_GGGA(X1, X2, cons(X3, X4), X5)

The TRS R consists of the following rules:

flattencB_in_ggga(X1, X2, X3, X4) → U24_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X4))
flattencC_in_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → U21_ggga(X1, X2, X3, X4, flattencD_in_ga(X3, X4))
flattencD_in_ga(atom(X1), .(X1, [])) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2), .(X1, X3)) → U19_ga(X1, X2, X3, flattencD_in_ga(X2, X3))
flattencD_in_ga(cons(cons(X1, X2), X3), X4) → U20_ga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X4))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5)) → U22_ggga(X1, X2, X3, X4, X5, flattencC_in_ggga(X2, X3, X4, X5))
flattencC_in_ggga(cons(X1, X2), X3, X4, X5) → U23_ggga(X1, X2, X3, X4, X5, flattencC_in_ggga(X1, X2, cons(X3, X4), X5))
U23_ggga(X1, X2, X3, X4, X5, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, X5, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
U20_ga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, X3, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))
U21_ggga(X1, X2, X3, X4, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U24_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)

The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x1, x2)
atom(x1)  =  atom(x1)
flattencB_in_ggga(x1, x2, x3, x4)  =  flattencB_in_ggga(x1, x2, x3)
U24_ggga(x1, x2, x3, x4, x5)  =  U24_ggga(x1, x2, x3, x5)
flattencC_in_ggga(x1, x2, x3, x4)  =  flattencC_in_ggga(x1, x2, x3)
U21_ggga(x1, x2, x3, x4, x5)  =  U21_ggga(x1, x2, x3, x5)
flattencD_in_ga(x1, x2)  =  flattencD_in_ga(x1)
flattencD_out_ga(x1, x2)  =  flattencD_out_ga(x1, x2)
U19_ga(x1, x2, x3, x4)  =  U19_ga(x1, x2, x4)
U20_ga(x1, x2, x3, x4, x5)  =  U20_ga(x1, x2, x3, x5)
U22_ggga(x1, x2, x3, x4, x5, x6)  =  U22_ggga(x1, x2, x3, x4, x6)
U23_ggga(x1, x2, x3, x4, x5, x6)  =  U23_ggga(x1, x2, x3, x4, x6)
flattencC_out_ggga(x1, x2, x3, x4)  =  flattencC_out_ggga(x1, x2, x3, x4)
flattencB_out_ggga(x1, x2, x3, x4)  =  flattencB_out_ggga(x1, x2, x3, x4)
.(x1, x2)  =  .(x1, x2)
FLATTENC_IN_GGGA(x1, x2, x3, x4)  =  FLATTENC_IN_GGGA(x1, x2, x3)
FLATTEND_IN_GA(x1, x2)  =  FLATTEND_IN_GA(x1)

We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FLATTENC_IN_GGGA(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → FLATTEND_IN_GA(X3, X4)
FLATTEND_IN_GA(cons(atom(X1), X2), .(X1, X3)) → FLATTEND_IN_GA(X2, X3)
FLATTEND_IN_GA(cons(cons(X1, X2), X3), X4) → FLATTENC_IN_GGGA(X1, X2, X3, X4)
FLATTENC_IN_GGGA(atom(X1), cons(X2, X3), X4, .(X1, X5)) → FLATTENC_IN_GGGA(X2, X3, X4, X5)
FLATTENC_IN_GGGA(cons(X1, X2), X3, X4, X5) → FLATTENC_IN_GGGA(X1, X2, cons(X3, X4), X5)

R is empty.
The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x1, x2)
atom(x1)  =  atom(x1)
.(x1, x2)  =  .(x1, x2)
FLATTENC_IN_GGGA(x1, x2, x3, x4)  =  FLATTENC_IN_GGGA(x1, x2, x3)
FLATTEND_IN_GA(x1, x2)  =  FLATTEND_IN_GA(x1)

We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

FLATTENC_IN_GGGA(atom(X1), atom(X2), X3) → FLATTEND_IN_GA(X3)
FLATTEND_IN_GA(cons(atom(X1), X2)) → FLATTEND_IN_GA(X2)
FLATTEND_IN_GA(cons(cons(X1, X2), X3)) → FLATTENC_IN_GGGA(X1, X2, X3)
FLATTENC_IN_GGGA(atom(X1), cons(X2, X3), X4) → FLATTENC_IN_GGGA(X2, X3, X4)
FLATTENC_IN_GGGA(cons(X1, X2), X3, X4) → FLATTENC_IN_GGGA(X1, X2, cons(X3, X4))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

FLATTENC_IN_GGGA(atom(X1), atom(X2), X3) → FLATTEND_IN_GA(X3)
FLATTEND_IN_GA(cons(atom(X1), X2)) → FLATTEND_IN_GA(X2)
FLATTEND_IN_GA(cons(cons(X1, X2), X3)) → FLATTENC_IN_GGGA(X1, X2, X3)
FLATTENC_IN_GGGA(atom(X1), cons(X2, X3), X4) → FLATTENC_IN_GGGA(X2, X3, X4)
No rules are removed from R.

Used ordering: POLO with Polynomial interpretation [POLO]:

POL(FLATTENC_IN_GGGA(x1, x2, x3)) = 2·x1 + 2·x2 + 2·x3   
POL(FLATTEND_IN_GA(x1)) = 1 + 2·x1   
POL(atom(x1)) = 1 + x1   
POL(cons(x1, x2)) = x1 + x2   

(13) Obligation:

Q DP problem:
The TRS P consists of the following rules:

FLATTENC_IN_GGGA(cons(X1, X2), X3, X4) → FLATTENC_IN_GGGA(X1, X2, cons(X3, X4))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • FLATTENC_IN_GGGA(cons(X1, X2), X3, X4) → FLATTENC_IN_GGGA(X1, X2, cons(X3, X4))
    The graph contains the following edges 1 > 1, 1 > 2

(15) YES

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4)), s(X5)) → U8_GA(X1, X2, X3, X4, X5, flattencB_in_ggga(X2, X3, X4, X6))
U8_GA(X1, X2, X3, X4, X5, flattencB_out_ggga(X2, X3, X4, X6)) → COUNTA_IN_GA(X6, X5)
COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3)), s(s(X4))) → COUNTA_IN_GA(X3, X4)
COUNTA_IN_GA(cons(cons(X1, X2), X3), X4) → U11_GA(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X5))
U11_GA(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5, X4)

The TRS R consists of the following rules:

flattencB_in_ggga(X1, X2, X3, X4) → U24_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X4))
flattencC_in_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4))) → U21_ggga(X1, X2, X3, X4, flattencD_in_ga(X3, X4))
flattencD_in_ga(atom(X1), .(X1, [])) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2), .(X1, X3)) → U19_ga(X1, X2, X3, flattencD_in_ga(X2, X3))
flattencD_in_ga(cons(cons(X1, X2), X3), X4) → U20_ga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, X3, X4))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5)) → U22_ggga(X1, X2, X3, X4, X5, flattencC_in_ggga(X2, X3, X4, X5))
flattencC_in_ggga(cons(X1, X2), X3, X4, X5) → U23_ggga(X1, X2, X3, X4, X5, flattencC_in_ggga(X1, X2, cons(X3, X4), X5))
U23_ggga(X1, X2, X3, X4, X5, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, X5, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
U20_ga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, X3, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))
U21_ggga(X1, X2, X3, X4, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U24_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)

The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x1, x2)
atom(x1)  =  atom(x1)
flattencB_in_ggga(x1, x2, x3, x4)  =  flattencB_in_ggga(x1, x2, x3)
U24_ggga(x1, x2, x3, x4, x5)  =  U24_ggga(x1, x2, x3, x5)
flattencC_in_ggga(x1, x2, x3, x4)  =  flattencC_in_ggga(x1, x2, x3)
U21_ggga(x1, x2, x3, x4, x5)  =  U21_ggga(x1, x2, x3, x5)
flattencD_in_ga(x1, x2)  =  flattencD_in_ga(x1)
flattencD_out_ga(x1, x2)  =  flattencD_out_ga(x1, x2)
U19_ga(x1, x2, x3, x4)  =  U19_ga(x1, x2, x4)
U20_ga(x1, x2, x3, x4, x5)  =  U20_ga(x1, x2, x3, x5)
U22_ggga(x1, x2, x3, x4, x5, x6)  =  U22_ggga(x1, x2, x3, x4, x6)
U23_ggga(x1, x2, x3, x4, x5, x6)  =  U23_ggga(x1, x2, x3, x4, x6)
flattencC_out_ggga(x1, x2, x3, x4)  =  flattencC_out_ggga(x1, x2, x3, x4)
flattencB_out_ggga(x1, x2, x3, x4)  =  flattencB_out_ggga(x1, x2, x3, x4)
.(x1, x2)  =  .(x1, x2)
COUNTA_IN_GA(x1, x2)  =  COUNTA_IN_GA(x1)
U8_GA(x1, x2, x3, x4, x5, x6)  =  U8_GA(x1, x2, x3, x4, x6)
U11_GA(x1, x2, x3, x4, x5)  =  U11_GA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(17) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4))) → U8_GA(X1, X2, X3, X4, flattencB_in_ggga(X2, X3, X4))
U8_GA(X1, X2, X3, X4, flattencB_out_ggga(X2, X3, X4, X6)) → COUNTA_IN_GA(X6)
COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3))) → COUNTA_IN_GA(X3)
COUNTA_IN_GA(cons(cons(X1, X2), X3)) → U11_GA(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U11_GA(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5)

The TRS R consists of the following rules:

flattencB_in_ggga(X1, X2, X3) → U24_ggga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencD_in_ga(atom(X1)) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U24_ggga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)

The set Q consists of the following terms:

flattencB_in_ggga(x0, x1, x2)
flattencC_in_ggga(x0, x1, x2)
flattencD_in_ga(x0)
U23_ggga(x0, x1, x2, x3, x4)
U22_ggga(x0, x1, x2, x3, x4)
U20_ga(x0, x1, x2, x3)
U19_ga(x0, x1, x2)
U21_ggga(x0, x1, x2, x3)
U24_ggga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(19) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4))) → U8_GA(X1, X2, X3, X4, flattencB_in_ggga(X2, X3, X4)) at position [4] we obtained the following new rules [LPAR04]:

COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4))) → U8_GA(X1, X2, X3, X4, U24_ggga(X2, X3, X4, flattencC_in_ggga(X2, X3, X4)))

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U8_GA(X1, X2, X3, X4, flattencB_out_ggga(X2, X3, X4, X6)) → COUNTA_IN_GA(X6)
COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3))) → COUNTA_IN_GA(X3)
COUNTA_IN_GA(cons(cons(X1, X2), X3)) → U11_GA(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U11_GA(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5)
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4))) → U8_GA(X1, X2, X3, X4, U24_ggga(X2, X3, X4, flattencC_in_ggga(X2, X3, X4)))

The TRS R consists of the following rules:

flattencB_in_ggga(X1, X2, X3) → U24_ggga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencD_in_ga(atom(X1)) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U24_ggga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)

The set Q consists of the following terms:

flattencB_in_ggga(x0, x1, x2)
flattencC_in_ggga(x0, x1, x2)
flattencD_in_ga(x0)
U23_ggga(x0, x1, x2, x3, x4)
U22_ggga(x0, x1, x2, x3, x4)
U20_ga(x0, x1, x2, x3)
U19_ga(x0, x1, x2)
U21_ggga(x0, x1, x2, x3)
U24_ggga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(21) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(22) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U8_GA(X1, X2, X3, X4, flattencB_out_ggga(X2, X3, X4, X6)) → COUNTA_IN_GA(X6)
COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3))) → COUNTA_IN_GA(X3)
COUNTA_IN_GA(cons(cons(X1, X2), X3)) → U11_GA(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U11_GA(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5)
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4))) → U8_GA(X1, X2, X3, X4, U24_ggga(X2, X3, X4, flattencC_in_ggga(X2, X3, X4)))

The TRS R consists of the following rules:

flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U24_ggga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
flattencD_in_ga(atom(X1)) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))

The set Q consists of the following terms:

flattencB_in_ggga(x0, x1, x2)
flattencC_in_ggga(x0, x1, x2)
flattencD_in_ga(x0)
U23_ggga(x0, x1, x2, x3, x4)
U22_ggga(x0, x1, x2, x3, x4)
U20_ga(x0, x1, x2, x3)
U19_ga(x0, x1, x2)
U21_ggga(x0, x1, x2, x3)
U24_ggga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(23) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

flattencB_in_ggga(x0, x1, x2)

(24) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U8_GA(X1, X2, X3, X4, flattencB_out_ggga(X2, X3, X4, X6)) → COUNTA_IN_GA(X6)
COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3))) → COUNTA_IN_GA(X3)
COUNTA_IN_GA(cons(cons(X1, X2), X3)) → U11_GA(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U11_GA(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5)
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4))) → U8_GA(X1, X2, X3, X4, U24_ggga(X2, X3, X4, flattencC_in_ggga(X2, X3, X4)))

The TRS R consists of the following rules:

flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U24_ggga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
flattencD_in_ga(atom(X1)) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))

The set Q consists of the following terms:

flattencC_in_ggga(x0, x1, x2)
flattencD_in_ga(x0)
U23_ggga(x0, x1, x2, x3, x4)
U22_ggga(x0, x1, x2, x3, x4)
U20_ga(x0, x1, x2, x3)
U19_ga(x0, x1, x2)
U21_ggga(x0, x1, x2, x3)
U24_ggga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(25) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


COUNTA_IN_GA(cons(atom(X1), cons(atom(X2), X3))) → COUNTA_IN_GA(X3)
COUNTA_IN_GA(cons(atom(X1), cons(cons(X2, X3), X4))) → U8_GA(X1, X2, X3, X4, U24_ggga(X2, X3, X4, flattencC_in_ggga(X2, X3, X4)))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 0   
POL(COUNTA_IN_GA(x1)) = 1 + x1   
POL(U11_GA(x1, x2, x3, x4)) = 1 + x4   
POL(U19_ga(x1, x2, x3)) = 0   
POL(U20_ga(x1, x2, x3, x4)) = x4   
POL(U21_ggga(x1, x2, x3, x4)) = 0   
POL(U22_ggga(x1, x2, x3, x4, x5)) = 0   
POL(U23_ggga(x1, x2, x3, x4, x5)) = x5   
POL(U24_ggga(x1, x2, x3, x4)) = 1 + x4   
POL(U8_GA(x1, x2, x3, x4, x5)) = x4 + x5   
POL([]) = 0   
POL(atom(x1)) = 1   
POL(cons(x1, x2)) = x1 + x2   
POL(flattencB_out_ggga(x1, x2, x3, x4)) = 1 + x4   
POL(flattencC_in_ggga(x1, x2, x3)) = 0   
POL(flattencC_out_ggga(x1, x2, x3, x4)) = x4   
POL(flattencD_in_ga(x1)) = 0   
POL(flattencD_out_ga(x1, x2)) = 0   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U24_ggga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)

(26) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U8_GA(X1, X2, X3, X4, flattencB_out_ggga(X2, X3, X4, X6)) → COUNTA_IN_GA(X6)
COUNTA_IN_GA(cons(cons(X1, X2), X3)) → U11_GA(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U11_GA(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5)

The TRS R consists of the following rules:

flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U24_ggga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
flattencD_in_ga(atom(X1)) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))

The set Q consists of the following terms:

flattencC_in_ggga(x0, x1, x2)
flattencD_in_ga(x0)
U23_ggga(x0, x1, x2, x3, x4)
U22_ggga(x0, x1, x2, x3, x4)
U20_ga(x0, x1, x2, x3)
U19_ga(x0, x1, x2)
U21_ggga(x0, x1, x2, x3)
U24_ggga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(27) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.

(28) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U11_GA(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5)
COUNTA_IN_GA(cons(cons(X1, X2), X3)) → U11_GA(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))

The TRS R consists of the following rules:

flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U24_ggga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencB_out_ggga(X1, X2, X3, X4)
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
flattencD_in_ga(atom(X1)) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))

The set Q consists of the following terms:

flattencC_in_ggga(x0, x1, x2)
flattencD_in_ga(x0)
U23_ggga(x0, x1, x2, x3, x4)
U22_ggga(x0, x1, x2, x3, x4)
U20_ga(x0, x1, x2, x3)
U19_ga(x0, x1, x2)
U21_ggga(x0, x1, x2, x3)
U24_ggga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(29) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(30) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U11_GA(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5)
COUNTA_IN_GA(cons(cons(X1, X2), X3)) → U11_GA(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))

The TRS R consists of the following rules:

flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
flattencD_in_ga(atom(X1)) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))

The set Q consists of the following terms:

flattencC_in_ggga(x0, x1, x2)
flattencD_in_ga(x0)
U23_ggga(x0, x1, x2, x3, x4)
U22_ggga(x0, x1, x2, x3, x4)
U20_ga(x0, x1, x2, x3)
U19_ga(x0, x1, x2)
U21_ggga(x0, x1, x2, x3)
U24_ggga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(31) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

U24_ggga(x0, x1, x2, x3)

(32) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U11_GA(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5)
COUNTA_IN_GA(cons(cons(X1, X2), X3)) → U11_GA(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))

The TRS R consists of the following rules:

flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
flattencD_in_ga(atom(X1)) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))

The set Q consists of the following terms:

flattencC_in_ggga(x0, x1, x2)
flattencD_in_ga(x0)
U23_ggga(x0, x1, x2, x3, x4)
U22_ggga(x0, x1, x2, x3, x4)
U20_ga(x0, x1, x2, x3)
U19_ga(x0, x1, x2)
U21_ggga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(33) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


COUNTA_IN_GA(cons(cons(X1, X2), X3)) → U11_GA(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 0   
POL(COUNTA_IN_GA(x1)) = x1   
POL(U11_GA(x1, x2, x3, x4)) = x4   
POL(U19_ga(x1, x2, x3)) = 1   
POL(U20_ga(x1, x2, x3, x4)) = 0   
POL(U21_ggga(x1, x2, x3, x4)) = 0   
POL(U22_ggga(x1, x2, x3, x4, x5)) = x5   
POL(U23_ggga(x1, x2, x3, x4, x5)) = x5   
POL([]) = 0   
POL(atom(x1)) = 0   
POL(cons(x1, x2)) = 1 + x1 + x2   
POL(flattencC_in_ggga(x1, x2, x3)) = 0   
POL(flattencC_out_ggga(x1, x2, x3, x4)) = x4   
POL(flattencD_in_ga(x1)) = x1   
POL(flattencD_out_ga(x1, x2)) = 0   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)

(34) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U11_GA(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X5)) → COUNTA_IN_GA(X5)

The TRS R consists of the following rules:

flattencC_in_ggga(atom(X1), atom(X2), X3) → U21_ggga(X1, X2, X3, flattencD_in_ga(X3))
flattencC_in_ggga(atom(X1), cons(X2, X3), X4) → U22_ggga(X1, X2, X3, X4, flattencC_in_ggga(X2, X3, X4))
flattencC_in_ggga(cons(X1, X2), X3, X4) → U23_ggga(X1, X2, X3, X4, flattencC_in_ggga(X1, X2, cons(X3, X4)))
U23_ggga(X1, X2, X3, X4, flattencC_out_ggga(X1, X2, cons(X3, X4), X5)) → flattencC_out_ggga(cons(X1, X2), X3, X4, X5)
U22_ggga(X1, X2, X3, X4, flattencC_out_ggga(X2, X3, X4, X5)) → flattencC_out_ggga(atom(X1), cons(X2, X3), X4, .(X1, X5))
flattencD_in_ga(atom(X1)) → flattencD_out_ga(atom(X1), .(X1, []))
flattencD_in_ga(cons(atom(X1), X2)) → U19_ga(X1, X2, flattencD_in_ga(X2))
flattencD_in_ga(cons(cons(X1, X2), X3)) → U20_ga(X1, X2, X3, flattencC_in_ggga(X1, X2, X3))
U21_ggga(X1, X2, X3, flattencD_out_ga(X3, X4)) → flattencC_out_ggga(atom(X1), atom(X2), X3, .(X1, .(X2, X4)))
U20_ga(X1, X2, X3, flattencC_out_ggga(X1, X2, X3, X4)) → flattencD_out_ga(cons(cons(X1, X2), X3), X4)
U19_ga(X1, X2, flattencD_out_ga(X2, X3)) → flattencD_out_ga(cons(atom(X1), X2), .(X1, X3))

The set Q consists of the following terms:

flattencC_in_ggga(x0, x1, x2)
flattencD_in_ga(x0)
U23_ggga(x0, x1, x2, x3, x4)
U22_ggga(x0, x1, x2, x3, x4)
U20_ga(x0, x1, x2, x3)
U19_ga(x0, x1, x2)
U21_ggga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(35) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(36) TRUE